<extend name="Public/base" />
<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>会员卡列表</h2>
    </div>
    <div class="cf">
        <div class="fl hide">
            <a class="btn btn-default" href="{:U('add')}">添  加</a> 
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <form action="{:U('SpMembercard/index')}" method='post' id="form-search">
                    <select name="type" class="search-input" >
                        <option value='cardnumber' <eq name='type' value='cardnumber'>selected="selected"</eq>>会员卡号</option>
                        <option value="name" <eq name='type' value='name'>selected="selected"</eq>>姓名</option>
                        <option value="phone" <eq name='type' value='phone'>selected="selected"</eq>>电话</option>
                    </select>
                    <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="请输入商品名称">
                    <a class="sch-btn" href="javascript:;" id="search" url="{:U('index')}"><i class="btn-search" id="submit"></i></a> 
                </form>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table>
            <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th> 
                    <th>会员卡号</th>
                    <th>会员卡姓名</th>
                    <th>联系电话</th>
                    <th>账户金额</th>
                    <th>开卡门店</th>
                    <th>开卡时间</th>
                    <th>上次使用时间</th>
                    <th>备注</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                        <td>{$vo.cardNum} </td>
                        <td>{$vo.name}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.amount}</td>
                        <td>{$vo.openCardShopId|get_sp_shop_name}</td>
                        <td>{$vo.openCardDate|time_format}</td>
                        <td>{$vo.updateat|time_format}</td>
                        <td>{$vo.remark}</td>
                        <td>{$vo.status_text}</td>
                        <td>
                            <a href="{:U('SpMembercard/detail')}&id={$vo['id']}" class="btn btn-primary">详情</a>
                           
                            <eq name="vo.status" value="1">
                            <a href="{:U('SpMembercard/changeStatus?id='.$vo['id'])}&method=forbid" class="confirm ajax-get btn btn-warning ">禁用</a>
                    <else/>
                    <a href="{:U('SpMembercard/changeStatus?id='.$vo['id'])}&method=resume" class="confirm ajax-get btn btn-warning">启用</a>
                    </eq>
                    </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索查询
        $('#submit').click(function () {
            document.getElementById("form-search").submit()
        }); 
        //导航高亮
        highlight_subnav('{:U('SpMembercard/index')}');
    </script>
</block>